﻿<%@ Page Title="Select Post" Language="C#" AutoEventWireup="true" CodeFile="SelectPost.aspx.cs" Inherits="Topics_PopUp_SelectPost" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title><%=this.Title%></title>
    <script type="text/javascript">
        function confirmClick(sender, e) {
            var msg = "Are you sure you want to add '";
            msg += e.get_node().get_text();
            msg += "' to this topic?";

            if (!confirm(msg)) {
                e.set_cancel(true);
            }
        }

        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }

        function returnToParent(hasSaved) {
            //create the argument that will be returned to the parent page
            var oArg = new Object();

            oArg.saved = hasSaved;

            //get a reference to the RadWindow
            var oWnd = GetRadWindow();

            //set the argument to the RadWindow
            oWnd.argument = oArg;
            //close the RadWindow
            oWnd.close();

            return false;
        }

    </script>
</head>
<body class="popup">
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="scriptManager" runat="server" />
    <div>
        <telerik:RadTreeView ID="treeSite" runat="server" 
            DataSourceID="dsMap" OnDataBound="treeSite_DataBound" OnNodeExpand="treeSite_NodeExpand" LoadingStatusPosition="BelowNodeText" OnNodeDataBound="treeSite_NodeDataBound" OnClientNodeClicking="confirmClick" OnNodeClick="treeSite_NodeClick"
            >
<CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation>

<ExpandAnimation Duration="100"></ExpandAnimation>
            <DataBindings>
                <telerik:RadTreeNodeBinding TextField="DisplayName" ValueField="Id" ToolTipField="Id" />
            </DataBindings>
        </telerik:RadTreeView>
        <asp:button ID="btnCancel" OnClientClick="return returnToParent(false);" Text="Cancel" runat="server" />
        <acms:AcmsSiteMapDataSource ID="dsMap" runat="server" />
    </div>
    </form>
</body>
</html>
